package day07.ZiXi;

import java.time.DayOfWeek;
import java.time.LocalDateTime;

public class LocalDateTime02 {
    public static void main(String[] args) {
        LocalDateTime localDateTime = LocalDateTime.of(2014,04,11,13,58,14);
        //public int getYear()        获取年
        int year = localDateTime.getYear();
        System.out.println("年为:"+year);
        //public int getMonthValue()获取月份（1-12）
        int month = localDateTime.getDayOfMonth();
        System.out.println("月为:"+month);
        //public int getDayOfMonth()获取月份中的第几天（1-31）
        int day = localDateTime.getDayOfMonth();
        System.out.println("这个月中的第"+day+"天");
        //public int getDayOfYear()获取一年中的第几天（1-366）
        int dayOfYear = localDateTime.getDayOfYear();
        System.out.println("这一年的第"+dayOfYear+"天");
        //public DayOfWeek getDayOfWeek()获取星期
        DayOfWeek dayOfweek = localDateTime.getDayOfWeek();
        System.out.println("星期为:"+dayOfweek);
        //public int getMinute()获取分钟
        int minute = localDateTime.getMinute();
        System.out.println("分钟为:"+minute);
        //public int getHour()获取小时
        int hour = localDateTime.getHour();
        System.out.println("小时为:"+hour);

    }
}
